<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>v-bind</title>
</head>
<body>

<div id="app">
  <h2 :style="{color: finallyColor}">{{message}}</h2>
  <h2 :style="{fontSize: finallySize + 'px'}">{{message}}</h2>
  <h2 :style="getStyles()">{{message}}</h2>
</div>
<script src="../js/vue.js"></script>
<script>
  const app = new Vue({
    el: '#app',
    data: {
      message: '你好',
      finallyColor: 'blue',
      finallySize: 99
    },
    methods: {
      getStyles: function () {
          return {fontSize: this.finallySize + 'px', backgroundColor: 'gray'}
      }
    }
  })
</script>
</body>
</html>
